<template>
    <rx-dialog @handOk="handleSubmit" @cancel="cancel">
        <rx-layout>
            <div slot="center">
                <a-form-model ref="form" :model="mdl" :label-col="labelCol" :wrapper-col="wrapperCol">
                    <a-form-model-item :label="i18n('form.jobName','任务名称')" prop="kettleJobName">
                        {{mdl.kettleJobName}}
                    </a-form-model-item>
                    <a-form-model-item :label="i18n('form.status','状态')" prop="status">
                        <a-tag :color="statusMap[mdl.status].color">
                            <span>{{ statusMap[mdl.status].text }}</span>
                        </a-tag>
                    </a-form-model-item>
                    <a-form-model-item :label="i18n('form.startTime','开始时间')" prop="startTime">
                        {{mdl.startTime}}
                    </a-form-model-item>
                    <a-form-model-item :label="i18n('form.endTime','结束时间')" prop="endTime">
                        {{mdl.endTime}}
                    </a-form-model-item>
                    <a-form-model-item :label="i18n('form.druation','运行时长(毫秒)')" prop="druation">
                        {{mdl.druation}}
                    </a-form-model-item>
                    <a-form-model-item :label="i18n('form.log','日志')" prop="log">
                        <div class="esit-log">{{mdl.log}}</div>
                    </a-form-model-item>
                </a-form-model>
            </div>
        </rx-layout>
    </rx-dialog>
</template>
<script>
import SysKettleLogApi from '@/api/system/core/sysKettleLog'
import {RxDialog, BaseFormModel} from "@lowcode/jpaas-common-lib";


export default {
    name: 'SysKettleLogEdit',
    mixins: [BaseFormModel],
    components: {
        RxDialog,
    },
    data() {
        return {
            /**
             * 子表列表，以及表格属性
             */
            subTable: {},
            statusMap: {
                '1': {color: 'green', text: this.i18n('form.success','成功')},
                '0': {color: 'blue', text: this.i18n('form.failure','失败')}
            }
        }

    },
    methods: {
        i18n(name,text,key){
            return this.$ti18(name,text,"SysKettleLog",key);
        },
        get(id) {
            return SysKettleLogApi.get(id);
        },

        save() {
            return SysKettleLogApi.save(this.mdl);
        },

    }
}
</script>
<style>
.relick a {
    margin-right: 10px;
}
.esit-log{
    height: 300px;
    overflow: auto;
    border:1px solid #f0f2f5;
    border-radius: 5px;
    padding: 10px;
}
</style>
